package cn.lisens.sm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.statemachine.StateMachine;

import cn.lisens.sm.enums.Events;
import cn.lisens.sm.enums.States;

public class MyService {

	@Autowired
    private StateMachine<States, Events> stateMachine;

    public void doTransition(Events event) {
        stateMachine.sendEvent(event);
    }

    public States getCurrentState() {
        return stateMachine.getState().getId();
    }
}
